﻿//-----------------------------------------------------------------------
// <copyright file="Global.asax.cs" company="Simnova LLC">
//     Copyright (c) Simnova LLC. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Simnova.Collaborate.ASPMVC
{
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    using System.Web.Security;
    using System.Web.SessionState;
    using System.Xml.Linq;
    using System.Web.Routing;

    public class Global : System.Web.HttpApplication
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            // Note: Change the URL to "{controller}.mvc/{action}/{id}" to enable
            //       automatic support on IIS6 and IIS7 classic mode

            routes.Add(new Route("Dashboard", new MvcRouteHandler())
            {
                Defaults = new RouteValueDictionary(new { controller = "Dashboard", action = "Index", id = "" }),
            });

            routes.Add(new Route("{controller}/{action}/{id}", new MvcRouteHandler())
            {
                Defaults = new RouteValueDictionary(new { action = "Index", id = "" }),
            });

            routes.Add(new Route("Default.aspx", new MvcRouteHandler())
            {
                Defaults = new RouteValueDictionary(new { controller = "Login", action = "Index", id = "" }),
            });
        }

        protected void Application_Start(object sender, EventArgs e)
        {
            this.RegisterRoutes(RouteTable.Routes);
        }
    }
}